<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <style>
      #heart {
        margin: 100px auto;
        position: relative;
        width: 100px;
        height: 90px;
        /* background-color: yellow; */
      }
      #heart:before{
        position: absolute;
        content: "";
        left: 10px;
        top: 0;
        width: 50px;
        height: 80px;
        background: red;
        border-radius: 50px 50px 0 0;
        transform: rotate(-45deg);
      }
      #heart::after{
        position: absolute;
        content: "";
        left: 32px;
        top: 0;
        width: 50px;
        height: 80px;
        background: red;
        border-radius: 50px 50px 0 0;
        transform: rotate(45deg);
      }
      #eg {
        margin: 100px auto;
        position: relative;
        width: 100px;
        height: 90px;
        background-color: yellow;
      }
      #eg:before{
        position: absolute;
        content: "";
        left: 10px;
        top: 0;
        width: 50px;
        height: 80px;
        background: red;
        border-radius: 50px 50px 0 0;
        transform: rotate(-45deg);
      }
      #eg::after{
        position: absolute;
        content: "";
        left: 32px;
        top: 0;
        width: 50px;
        height: 80px;
        background: green;
        border-radius: 50px 50px 0 0;
        transform: rotate(45deg);
      }
    /* -----------------下边网上  */
      /* #heart:before,
      #heart:after {
        position: absolute;
        content: "";
        left: 50px;
        top: 0;
        width: 50px;
        height: 80px;
        background: red;
        border-radius: 50px 50px 0 0;
        transform: rotate(-45deg);
        /* 参数  x  y  z 轴  */
        /* transform-origin: 0 100%;
      }
      #heart:after {
        left: 0;
        transform: rotate(45deg);
        transform-origin: 100% 100%;
      } */
    </style>
  </head>
  <body>
    <div id="heart"></div>

    <p>transform-origin属性用于设置旋转元素的基点位置，熟悉使用transform-origin并结合CSS3动画可以使元素沿着某一基点进行旋转，位移等</p>
    <p>eg:爱心  ：利用两个小长方形 设置同一侧边框角度 在对其旋转+定位</p>
    <div id="eg"></div>

  </body>
</html>
